import {Component} from 'react';
import WithRoute from '../router/withRoute';
//  import {useLocation} from 'react-router-dom'
// function Info(){
//     // 获取当前路由详细信息
//     let location = useLocation();
//     console.log(location)
//     let {id,price} = location.state;
//     return (
//         <div>
//             <h1>详情页---{id}----{price}</h1>
//         </div>
//     )
// }

// export default Info;
class Info extends Component{
    
    render(){
       console.log(this.props)
       let {id,price}= this.props.router.location.state;
        return (
            <div>
                <h1>详情页 {id}----{price}</h1>
            </div>
        )
    }
}
export default WithRoute(Info)